package com.atghost.miniofile.dto.res;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author Admin
 * @version 1.0
 * @date 2024-5-19 11:34
 **/
@Getter
@Setter
public class CommBo {
    private static Log logger = LogFactory.getLog(CommBo.class);

    private Boolean operateSuccess;

    private String msg;

    private String dataAccountId;

    private Integer pageNo = 1;

    private Integer pageSize = 10;

    private Long totals;

    /**
     * @description 设置失败Bo
     */
    public static void setFailBo(CommBo bo, Exception e) {
        logger.error(e.getMessage());
        e.printStackTrace();
        bo.setMsg("失败" + " " + e.getMessage());
        bo.setOperateSuccess(false);
    }

    /**
     * @description 设置成功Bo
     */
    public static void setSuccessBo(CommBo bo) {
        bo.setMsg("成功");
        bo.setOperateSuccess(true);
    }

}
